package Lab5.AbstractMonster;

import Lab5.AbstractMonster.Monster;

public class Troll extends Monster {

    public Troll(String name) {
        super(name);
    }

    public Troll(String name, int spAttackProbability) {
        super(name, spAttackProbability);
    }

    @Override
    protected int specialAttack() {
        if (this.random.nextInt(10) < 3) {
            int randomNum = this.random.nextInt(15) + 1;
            System.out.printf("%s, of type %s,attacks hit with stack: %d points damage caused.\n", this.name, this.getClass(), randomNum);
            return randomNum;
        } else {
            return super.attack();
        }
    }
}
